
<div class="panel1"> <div class="wrp-comment">
<?php if($is_login):?>
<form id="frm-reply" action="<?php echo site_url('c=topic&m=reply_do');?>"
	submitbefor="reply_save_befor"
	submitafter="reply_save_after"
>
	<input type="hidden" value="<?php echo $tid;?>" name="tid"/>
	<input id="cont" class="inp1" name="cont"/>
	<a class="btn btn-7 btn-ajax-submit" frmid="frm-reply" href="javascript:void(0);">发表</a>
</form>
<?php endif;?>
<div id="c-list-reply"></div>
<div class="b1"></div>
<div id="pagereply" class="jspage"></div>

</div> <div style="clear: both;"></div> </div>

<script>
function reply_save_befor($frm){
	var cont = $('#cont').val();
	if(cont.length<=0){
		asyncbox.tips('能容不能为空!','error');
		return false;
	} 
	return true;
}

function reply_save_after(msg,$frm){
	$('#cont').val('');
	var $topic = $frm.parents('.topic');
	$topic.find('.panel-comment').load($topic.find('.btn-comment').attr('href'));
	return true;
}

function ajax_page_reply(page){
	var url = '<?php echo site_url('c=topic&m=list_reply&tid='.$tid.'&page=');?>'+page;
	$('#c-list-reply').load(url);
}

$(function(){

	ajaxinit();
	ajax_page_reply(1);

	$("#pagereply").pagination(<?php echo $total_count_reply;?>, {
		num_edge_entries: 2, //边缘页数
		num_display_entries: 10, //主体页数
		callback: function(i){
			ajax_page_reply(i+1);
			return false;
		},
		items_per_page:<?php echo REPLY_PAGESIZE;?> 
	});
	
	
});
</script>